<!--
	This is the Category page
-->
<?php include 'session.php'?>

<?php
$allCategories = $soap->call( $session_id, 'catalog_category.tree');
// echo print_r($allCategories);
$root_children = $allCategories['children'];
$children = $root_children[0]['children'];
// echo print_r($children);
$len_category = sizeof($children);
//echo $len_category;
?>

<?php
$num_items = 0;
if (isset($_SESSION['cid'])) {
	$cid = $_SESSION['cid'];
	$cartInfo = $soap->call ($session_id, 'cart.info', $cid);
	// echo print_r($cartInfo);
	$items = $cartInfo['items'];
	$num_items = sizeof($items);
} else {
	$cid = $soap->call ($session_id, 'cart.create');
	$_SESSION['cid'] = $cid;
	$num_items = 0;
}
?>

<html class="no-js" lang="en">

<head>
	<title>Shopping Cart</title>
	
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;" />
	<meta name="format-detection" content="telephone=no" />

	<!-- todo <link rel="shortcut icon" type="image/ico" href="http://images/favicon.ico" />-->

	<link rel="stylesheet" href="css/reset.css" />
	<link rel="stylesheet" href="css/utils.css" />
	<link rel="stylesheet" href="css/layout.css" />
	<link rel="stylesheet" href="css/typography.css" />
	<link rel="stylesheet" href="css/lists.css" />
	<link rel="stylesheet" href="css/forms.css" />
	<link rel="stylesheet" href="css/blocks.css" />
	<link rel="stylesheet" href="css/media-queries.css" />

	<script src="js/json2.js"></script>
	<script src="js/zepto.js"></script>
	<script src="js/m-trapeze.js"></script>
	<script src="js/m-carousel.js"></script>
	<script src="js/m-statusbar.js"></script>

</head>
<body>
	<div id="Wrapper">
		<header id="Chrome">
			<h1 id="Logo"></h1>
			<nav id="ChromeNav">
				<ul>
					<li id="NavHome"><a href="home.php" class="icon">Home</a></li>
					<li id="NavLocator"><a href="/locator/search/"><span class="word">Find</span> <span class="word">Locations</span> </a></li>
					<li id="NavSearch"><a href="/search/" class="icon">Search</a></li>
				</ul>
			</nav>

			<form id="FormLocator" action="choice.php" method="get" class="chrome-block">
				<div class="container">
					<label for="id_location">Enter Zip or City Name</label>
					<div class="wrapper">
						<button id="LocatorCurrent" class="button-primary">Use Curent Location</button>
						<input id="id_location" name="location" type="text"  />
						<input id="id_lat" name="lat" type="hidden" />
						<input id="id_lng" name="lng" type="hidden" />
						<input id="id_geocode_results" name="geocode_results" type="hidden" />
						<button id="LocatorSearch" class="button-secondary" type="submit">Search</button>
					</div>
				</div>
			</form>

			<form id="FormSearch" action="sphider/search.php" method="get" class="chrome-block">
				<div class="container">
					<label for="id_q">Search</label>
					<div class="wrapper">
					<input id="id_q" name="q"  type="text" />
					<button class="button-secondary" type="submit">Search</button>
				</div>
				</div>
			</form>
		</header>
		<div>
			
			<div id="Content">
				<?php include 'showcategory.php'?>

				<br/>
				<div style="margin-left:10px; margin-top:5px">
					<ul class="buttons">
						<li>
						<a href="cart.php?" class="button-secondary">View Cart (<?php echo $num_items;?>)</a>
						</li>
					</ul>
				</div>
			</div>
			

<?php include 'footer.php'?>